USE kaiyue

declare @sql varchar(8000)
while (select count(*) from sysobjects where type='U')>0
begin

	SELECT @sql='drop table ' + name
	FROM sysobjects
	WHERE (type = 'U')
	ORDER BY 'drop table ' + name

	exec(@sql) 
end 



declare @sql2 Nvarchar(4000)
while (select count(*) from sys.procedures )>0
begin

	SELECT @sql2='drop PROC ' + name
	FROM  sys.procedures
	ORDER BY 'drop PROC ' + name

	exec(@sql2) 
end 


declare @sql3 Nvarchar(4000)
while (select count(*) from sys.objects where type='FN' )>0
begin

	SELECT @sql3='drop FUNCTION ' + name
	FROM  sys.objects where type='FN' 
	ORDER BY 'drop FUNCTION ' + name

	exec(@sql3) 
end 

